package cn.sxt.seata.controller;

import cn.sxt.seata.domain.CommonResult;
import cn.sxt.seata.entity.Order;
import cn.sxt.seata.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: --
 * @author：Bing
 * @date：2021/4/19 15:11
 * @version：1.0
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/save")
    public CommonResult saveOrder(Order order) {
        order.setStatus(0);
        orderService.insert(order);
        return new CommonResult(200, "订单创建成功------>");
    }
}
